home *** CD-ROM | disk | FTP | other *** search
/ Delphi Magazine Collection 2001 / Delphi Magazine Collection 20001 (2001).iso / DISKS / Issue48 / ComCorn / UrlTest_TLB.pas < prev    next >
Encoding:
Pascal/Delphi Source File  |  1998-06-23  |  13.1 KB  |  311 lines

  1. unit UrlTest_TLB;
  2.  
  3. // ************************************************************************ //
  4. // WARNING                                                                  //
  5. // -------                                                                  //
  6. // The types declared in this file were generated from data read from a     //
  7. // Type Library. If this type library is explicitly or indirectly (via      //
  8. // another type library referring to this type library) re-imported, or the //
  9. // 'Refresh' command of the Type Library Editor activated while editing the //
  10. // Type Library, the contents of this file will be regenerated and all      //
  11. // manual modifications will be lost.                                       //
  12. // ************************************************************************ //
  13.  
  14. // PASTLWTR : $Revision:   1.11.1.63  $
  15. // File generated on 6/23/98 12:28:02 AM from Type Library described below.
  16.  
  17. // ************************************************************************ //
  18. // Type Lib: C:\work\d4dg\code\Ch25\UrlTest\UrlTest.tlb
  19. // IID\LCID: {79B46E20-9C57-11D0-A9BF-00A024E3867F}\0
  20. // Helpfile: 
  21. // HelpString: UrlTest Library
  22. // Version:    1.0
  23. // ************************************************************************ //
  24.  
  25. interface
  26.  
  27. uses Windows, ActiveX, Classes, Graphics, OleCtrls, StdVCL;
  28.  
  29. // *********************************************************************//
  30. // GUIDS declared in the TypeLibrary. Following prefixes are used:      //
  31. //   Type Libraries     : LIBID_xxxx                                    //
  32. //   CoClasses          : CLASS_xxxx                                    //
  33. //   DISPInterfaces     : DIID_xxxx                                     //
  34. //   Non-DISP interfaces: IID_xxxx                                      //
  35. // *********************************************************************//
  36. const
  37.   LIBID_UrlTest: TGUID = '{79B46E20-9C57-11D0-A9BF-00A024E3867F}';
  38.   IID_IUrlTestForm: TGUID = '{79B46E21-9C57-11D0-A9BF-00A024E3867F}';
  39.   DIID_IUrlTestFormEvents: TGUID = '{79B46E22-9C57-11D0-A9BF-00A024E3867F}';
  40.   CLASS_UrlTestForm: TGUID = '{79B46E23-9C57-11D0-A9BF-00A024E3867F}';
  41.  
  42. // *********************************************************************//
  43. // Declaration of Enumerations defined in Type Library                  //
  44. // *********************************************************************//
  45. // TxActiveFormBorderStyle constants
  46. type
  47.   TxActiveFormBorderStyle = TOleEnum;
  48. const
  49.   afbNone = $00000000;
  50.   afbSingle = $00000001;
  51.   afbSunken = $00000002;
  52.   afbRaised = $00000003;
  53.  
  54. // TxPrintScale constants
  55. type
  56.   TxPrintScale = TOleEnum;
  57. const
  58.   poNone = $00000000;
  59.   poProportional = $00000001;
  60.   poPrintToFit = $00000002;
  61.  
  62. // TxMouseButton constants
  63. type
  64.   TxMouseButton = TOleEnum;
  65. const
  66.   mbLeft = $00000000;
  67.   mbRight = $00000001;
  68.   mbMiddle = $00000002;
  69.  
  70. // TxWindowState constants
  71. type
  72.   TxWindowState = TOleEnum;
  73. const
  74.   wsNormal = $00000000;
  75.   wsMinimized = $00000001;
  76.   wsMaximized = $00000002;
  77.  
  78. type
  79.  
  80. // *********************************************************************//
  81. // Forward declaration of interfaces defined in Type Library            //
  82. // *********************************************************************//
  83.   IUrlTestForm = interface;
  84.   IUrlTestFormDisp = dispinterface;
  85.   IUrlTestFormEvents = dispinterface;
  86.  
  87. // *********************************************************************//
  88. // Declaration of CoClasses defined in Type Library                     //
  89. // (NOTE: Here we map each CoClass to its Default Interface)            //
  90. // *********************************************************************//
  91.   UrlTestForm = IUrlTestForm;
  92.  
  93.  
  94. // *********************************************************************//
  95. // Interface: IUrlTestForm
  96. // Flags:     (4432) Hidden Dual OleAutomation Dispatchable
  97. // GUID:      {79B46E21-9C57-11D0-A9BF-00A024E3867F}
  98. // *********************************************************************//
  99.   IUrlTestForm = interface(IDispatch)
  100.     ['{79B46E21-9C57-11D0-A9BF-00A024E3867F}']
  101.     function Get_AutoScroll: WordBool; safecall;
  102.     procedure Set_AutoScroll(AutoScroll: WordBool); safecall;
  103.     function Get_AxBorderStyle: TxActiveFormBorderStyle; safecall;
  104.     procedure Set_AxBorderStyle(AxBorderStyle: TxActiveFormBorderStyle); safecall;
  105.     function Get_Caption: WideString; safecall;
  106.     procedure Set_Caption(const Caption: WideString); safecall;
  107.     function Get_Color: OLE_COLOR; safecall;
  108.     procedure Set_Color(Color: OLE_COLOR); safecall;
  109.     function Get_Font: IFontDisp; safecall;
  110.     procedure Set_Font(const Font: IFontDisp); safecall;
  111.     function Get_KeyPreview: WordBool; safecall;
  112.     procedure Set_KeyPreview(KeyPreview: WordBool); safecall;
  113.     function Get_PixelsPerInch: Integer; safecall;
  114.     procedure Set_PixelsPerInch(PixelsPerInch: Integer); safecall;
  115.     function Get_PrintScale: TxPrintScale; safecall;
  116.     procedure Set_PrintScale(PrintScale: TxPrintScale); safecall;
  117.     function Get_Scaled: WordBool; safecall;
  118.     procedure Set_Scaled(Scaled: WordBool); safecall;
  119.     function Get_Active: WordBool; safecall;
  120.     function Get_DropTarget: WordBool; safecall;
  121.     procedure Set_DropTarget(DropTarget: WordBool); safecall;
  122.     function Get_HelpFile: WideString; safecall;
  123.     procedure Set_HelpFile(const HelpFile: WideString); safecall;
  124.     function Get_WindowState: TxWindowState; safecall;
  125.     procedure Set_WindowState(WindowState: TxWindowState); safecall;
  126.     function Get_Visible: WordBool; safecall;
  127.     procedure Set_Visible(Visible: WordBool); safecall;
  128.     function Get_Enabled: WordBool; safecall;
  129.     procedure Set_Enabled(Enabled: WordBool); safecall;
  130.     function Get_Cursor: Smallint; safecall;
  131.     procedure Set_Cursor(Cursor: Smallint); safecall;
  132.     property AutoScroll: WordBool read Get_AutoScroll write Set_AutoScroll;
  133.     property AxBorderStyle: TxActiveFormBorderStyle read Get_AxBorderStyle write Set_AxBorderStyle;
  134.     property Caption: WideString read Get_Caption write Set_Caption;
  135.     property Color: OLE_COLOR read Get_Color write Set_Color;
  136.     property Font: IFontDisp read Get_Font write Set_Font;
  137.     property KeyPreview: WordBool read Get_KeyPreview write Set_KeyPreview;
  138.     property PixelsPerInch: Integer read Get_PixelsPerInch write Set_PixelsPerInch;
  139.     property PrintScale: TxPrintScale read Get_PrintScale write Set_PrintScale;
  140.     property Scaled: WordBool read Get_Scaled write Set_Scaled;
  141.     property Active: WordBool read Get_Active;
  142.     property DropTarget: WordBool read Get_DropTarget write Set_DropTarget;
  143.     property HelpFile: WideString read Get_HelpFile write Set_HelpFile;
  144.     property WindowState: TxWindowState read Get_WindowState write Set_WindowState;
  145.     property Visible: WordBool read Get_Visible write Set_Visible;
  146.     property Enabled: WordBool read Get_Enabled write Set_Enabled;
  147.     property Cursor: Smallint read Get_Cursor write Set_Cursor;
  148.   end;
  149.  
  150. // *********************************************************************//
  151. // DispIntf:  IUrlTestFormDisp
  152. // Flags:     (4432) Hidden Dual OleAutomation Dispatchable
  153. // GUID:      {79B46E21-9C57-11D0-A9BF-00A024E3867F}
  154. // *********************************************************************//
  155.   IUrlTestFormDisp = dispinterface
  156.     ['{79B46E21-9C57-11D0-A9BF-00A024E3867F}']
  157.     property AutoScroll: WordBool dispid 1;
  158.     property AxBorderStyle: TxActiveFormBorderStyle dispid 2;
  159.     property Caption: WideString dispid 3;
  160.     property Color: OLE_COLOR dispid 4;
  161.     property Font: IFontDisp dispid 5;
  162.     property KeyPreview: WordBool dispid 6;
  163.     property PixelsPerInch: Integer dispid 7;
  164.     property PrintScale: TxPrintScale dispid 8;
  165.     property Scaled: WordBool dispid 9;
  166.     property Active: WordBool readonly dispid 10;
  167.     property DropTarget: WordBool dispid 11;
  168.     property HelpFile: WideString dispid 12;
  169.     property WindowState: TxWindowState dispid 13;
  170.     property Visible: WordBool dispid 14;
  171.     property Enabled: WordBool dispid 15;
  172.     property Cursor: Smallint dispid 16;
  173.   end;
  174.  
  175. // *********************************************************************//
  176. // DispIntf:  IUrlTestFormEvents
  177. // Flags:     (4096) Dispatchable
  178. // GUID:      {79B46E22-9C57-11D0-A9BF-00A024E3867F}
  179. // *********************************************************************//
  180.   IUrlTestFormEvents = dispinterface
  181.     ['{79B46E22-9C57-11D0-A9BF-00A024E3867F}']
  182.     procedure OnActivate; dispid 1;
  183.     procedure OnClick; dispid 2;
  184.     procedure OnCreate; dispid 3;
  185.     procedure OnDblClick; dispid 4;
  186.     procedure OnDestroy; dispid 5;
  187.     procedure OnDeactivate; dispid 6;
  188.     procedure OnKeyPress(var Key: Smallint); dispid 7;
  189.     procedure OnPaint; dispid 8;
  190.   end;
  191.  
  192.  
  193. // *********************************************************************//
  194. // OLE Control Proxy class declaration
  195. // Control Name     : TUrlTestForm
  196. // Help String      : UrlTestFormControl
  197. // Default Interface: IUrlTestForm
  198. // Def. Intf. DISP? : No
  199. // Event   Interface: IUrlTestFormEvents
  200. // TypeFlags        : (34) CanCreate Control
  201. // *********************************************************************//
  202.   TUrlTestFormOnKeyPress = procedure(Sender: TObject; var Key: Smallint) of object;
  203.  
  204.   TUrlTestForm = class(TOleControl)
  205.   private
  206.     FOnActivate: TNotifyEvent;
  207.     FOnClick: TNotifyEvent;
  208.     FOnCreate: TNotifyEvent;
  209.     FOnDblClick: TNotifyEvent;
  210.     FOnDestroy: TNotifyEvent;
  211.     FOnDeactivate: TNotifyEvent;
  212.     FOnKeyPress: TUrlTestFormOnKeyPress;
  213.     FOnPaint: TNotifyEvent;
  214.     FIntf: IUrlTestForm;
  215.     function  GetControlInterface: IUrlTestForm;
  216.   protected
  217.     procedure CreateControl;
  218.     procedure InitControlData; override;
  219.   public
  220.     property  ControlInterface: IUrlTestForm read GetControlInterface;
  221.     property Active: WordBool index 10 read GetWordBoolProp;
  222.   published
  223.     property  Align;
  224.     property  DragCursor;
  225.     property  DragMode;
  226.     property  ParentShowHint;
  227.     property  PopupMenu;
  228.     property  ShowHint;
  229.     property  TabOrder;
  230.     property  OnDragDrop;
  231.     property  OnDragOver;
  232.     property  OnEndDrag;
  233.     property  OnEnter;
  234.     property  OnExit;
  235.     property  OnStartDrag;
  236.     property AutoScroll: WordBool index 1 read GetWordBoolProp write SetWordBoolProp stored False;
  237.     property AxBorderStyle: TOleEnum index 2 read GetTOleEnumProp write SetTOleEnumProp stored False;
  238.     property Caption: WideString index 3 read GetWideStringProp write SetWideStringProp stored False;
  239.     property Color: TColor index 4 read GetTColorProp write SetTColorProp stored False;
  240.     property Font: TFont index 5 read GetTFontProp write SetTFontProp stored False;
  241.     property KeyPreview: WordBool index 6 read GetWordBoolProp write SetWordBoolProp stored False;
  242.     property PixelsPerInch: Integer index 7 read GetIntegerProp write SetIntegerProp stored False;
  243.     property PrintScale: TOleEnum index 8 read GetTOleEnumProp write SetTOleEnumProp stored False;
  244.     property Scaled: WordBool index 9 read GetWordBoolProp write SetWordBoolProp stored False;
  245.     property DropTarget: WordBool index 11 read GetWordBoolProp write SetWordBoolProp stored False;
  246.     property HelpFile: WideString index 12 read GetWideStringProp write SetWideStringProp stored False;
  247.     property WindowState: TOleEnum index 13 read GetTOleEnumProp write SetTOleEnumProp stored False;
  248.     property Visible: WordBool index 14 read GetWordBoolProp write SetWordBoolProp stored False;
  249.     property Enabled: WordBool index 15 read GetWordBoolProp write SetWordBoolProp stored False;
  250.     property Cursor: Smallint index 16 read GetSmallintProp write SetSmallintProp stored False;
  251.     property OnActivate: TNotifyEvent read FOnActivate write FOnActivate;
  252.     property OnClick: TNotifyEvent read FOnClick write FOnClick;
  253.     property OnCreate: TNotifyEvent read FOnCreate write FOnCreate;
  254.     property OnDblClick: TNotifyEvent read FOnDblClick write FOnDblClick;
  255.     property OnDestroy: TNotifyEvent read FOnDestroy write FOnDestroy;
  256.     property OnDeactivate: TNotifyEvent read FOnDeactivate write FOnDeactivate;
  257.     property OnKeyPress: TUrlTestFormOnKeyPress read FOnKeyPress write FOnKeyPress;
  258.     property OnPaint: TNotifyEvent read FOnPaint write FOnPaint;
  259.   end;
  260.  
  261. procedure Register;
  262.  
  263. implementation
  264.  
  265. uses ComObj;
  266.  
  267. procedure TUrlTestForm.InitControlData;
  268. const
  269.   CEventDispIDs: array [0..7] of DWORD = (
  270.     $00000001, $00000002, $00000003, $00000004, $00000005, $00000006,
  271.     $00000007, $00000008);
  272.   CTFontIDs: array [0..0] of DWORD = (
  273.     $00000005);
  274.   CControlData: TControlData = (
  275.     ClassID: '{79B46E23-9C57-11D0-A9BF-00A024E3867F}';
  276.     EventIID: '{79B46E22-9C57-11D0-A9BF-00A024E3867F}';
  277.     EventCount: 8;
  278.     EventDispIDs: @CEventDispIDs;
  279.     LicenseKey: nil;
  280.     Flags: $00000000;
  281.     Version: 300;
  282.     FontCount: 1;
  283.     FontIDs: @CTFontIDs);
  284. begin
  285.   ControlData := @CControlData;
  286. end;
  287.  
  288. procedure TUrlTestForm.CreateControl;
  289.  
  290.   procedure DoCreate;
  291.   begin
  292.     FIntf := IUnknown(OleObject) as IUrlTestForm;
  293.   end;
  294.  
  295. begin
  296.   if FIntf = nil then DoCreate;
  297. end;
  298.  
  299. function TUrlTestForm.GetControlInterface: IUrlTestForm;
  300. begin
  301.   CreateControl;
  302.   Result := FIntf;
  303. end;
  304.  
  305. procedure Register;
  306. begin
  307.   RegisterComponents('ActiveX',[TUrlTestForm]);
  308. end;
  309.  
  310. end.
  311.